package model

import "github.com/gogf/gf/v2/util/gmeta"

type StaffIdRes struct {
	Id int64 `json:"id"  dc:"员工id"    v:"required#员工id必填"`
}

type StaffInfo struct {
	StaffName          string `json:"staffName"  dc:"员工名字" v:"required#请输入员工名称"`
	StaffCode          string `json:"staffCode"  dc:"员工编号"`
	StaffPhone         string `json:"staffPhone"  dc:"员工手机号码" v:"required|phone#手机号必填|不是一个正确的手机号"`
	CompanyId          int64  `json:"companyId"  dc:"公司Id"`
	RoleId             int64  `json:"roleId"  dc:"角色Id"`
	StaffHeadImg       string `json:"staffHeadImg"  dc:"员工头像" v:"url#头像不是一个正确的地址"`
	StaffEntryTime     string `json:"staffEntryTime"  dc:"员工员工入职时间" v:"datetime#入职时间格式不正确"`
	StaffDepartureTime string `json:"staffDepartureTime"  dc:"员工离职时间" v:"datetime#离职时间格式不正确"`
	DepartmentId       int64  `json:"departmentId"  dc:"该员工所属的部门Id"`
	StaffAddress       string `json:"staffAddress" dc:"员工家庭地址" v:"max-length:250#地址不能超过250个字"`
	StaffIdCard        string `json:"staffIdCard" dc:"员工身份证号" v:"resident-id#身份证格式错误"`
	StaffBirthday      string `json:"staffBirthday" dc:"员工生日" v:"datetime#员工生日格式不正确"`
	StaffSex           int    `json:"staffSex" dc:"1 男 2 女" v:"in:0,1,2#性别参数不正确"`
}

type StaffInfoDBRes struct {
	gmeta.Meta `orm:"table:lot_staff"`
	StaffInfo
}

type UpdateStaffInfo struct {
	StaffIdRes
	StaffInfo
}

type StaffInfoRes struct {
	StaffIdRes
	StaffInfo
	CompanyInfo    CompanyInfoReq     `json:"companyInfo"  dc:"该员工所属公司的信息"`
	DepartmentInfo DepartmentInfoRes  `json:"departmentInfo"  dc:"该员工所属部门的信息"`
	RoleInfo       RoleInfoRes        `json:"roleInfoRes"  dc:"该员工角色详情"`
	AuthInfo       []AuthInfoAndIdRes `json:"AuthInfo"  dc:"该员权限详情"`
}

type StaffListInfoRes struct {
	gmeta.Meta `orm:"table:lot_staff"`
	StaffIdRes
	StaffInfo
	DepartmentInfoRes *DepartmentInfoRes `json:"departmentInfo"  dc:"部门详情" orm:"with:id=department_id"`
	//RoleInfoRes       *RoleInfoRes       `json:"roleInfo"  dc:"部门详情" orm:"with:id=role_id"`
}

//type StaffListInfoArrayRes []*StaffListInfoRes

type StaffListPageRes struct {
	List []*StaffListInfoRes `json:"list"  dc:"员工列表"`
	PutPage
}

type SearchIdStaff struct {
	Id        int64 `json:"id"  dc:"员工id"`
	CompanyId int64 `json:"companyId"  dc:"公司Id"`
}

// StaffLoginStruct 员工登录入参
type StaffLoginStruct struct {
	Type      int    `json:"type"   v:"bail|required|in:1,2,3#|请选择登录类型|type错误,1密码登录,2手机登录,3微信登录"    dc:"1密码登录,2手机登录,3微信登录"`
	Username  string `json:"username"   v:"required-if:type,1#请输入员工名称" dc:"员工名称"`
	Phone     string `json:"phone"   v:"bail|required-if:type,2|phone#|请填写手机号|手机号不正确" dc:"手机号码"`
	PhoneCode string `json:"phoneCode"   v:"required-if:type,2#请填写手机验证码" dc:"手机验证码"`
	CompanyId int64  `json:"companyId"   v:"required#请选择公司" dc:"公司Id"`
	Password  string `json:"password"   v:"bail|required-if:type,1|password2#|账户登录请填写密码|密码必须包含大小写字母和数字" dc:"员工密码"`
}

// StaffWeiChatLogin 员工微信一键登录
type StaffWeiChatLogin struct {
	Phone string `json:"phone"   v:"bail|required|phone#|请填写手机号|手机号不正确" dc:"手机号码"`
}

type LoginCompanyList struct {
	CompanyName    string `json:"companyName"  dc:"公司名称"   `
	CompanyAddress string `json:"companyAddress"   dc:"公司地址" `
}

//type IsSMSSuccess struct {
//	Phone     string `json:"phone"   v:"bail|required|phone#|请填写手机号|手机号不正确" dc:"手机号码"`
//	PhoneCode string `json:"phoneCode"   v:"required-if:type,1#请填写手机验证码" dc:"手机验证码"`
//	Type      int    `json:"type"   v:"required|in:1,2,3#请填写手机验证类型" dc:"2手机验证码查询，3微信手机号查询"`
//}

type StaffListReq struct {
	StaffName    string `json:"staffName"  dc:"员工名字"`
	StaffCode    string `json:"staffCode"  dc:"员工编号"`
	StaffPhone   string `json:"staffPhone"  dc:"员工手机号码"`
	RoleId       string `json:"roleId"  dc:"角色Id"`
	CompanyId    int64  `json:"companyId" dc:"公司Id" v:"required#公司id必填"`
	DepartmentId string `json:"departmentId"  dc:"该员工所属的部门Id"`
	*Paging
}
